<template>
    <view>
  <u-popup :closeOnClickOverlay="false" mode="center" :show="show">
    <view class="box">
      <view class="title">欢迎使用剧多分</view>
      <view class="tip">
        <view>
          1、为切实保护剧多分用户的个人信息，未经您同意，我们不会从第三方获取、共享或对外提供你的信息。
        </view>
        <view>
          2、为了更好地为你提供使用服务并保障账号设备安全，我们会根据你使用功能的场景收集必要信息（如账号、设备信息等）
        </view>
        <view>
          3、阅读<text class="pro" @click="showModal=true;type=1">《用户服务协议》</text>和<text @click="showModal=true;type=2" class="pro"
            >《隐私政策》</text
          >了解详细信息。如你同意，请点击“同意”开始接受我们的服务。
        </view>
      </view>
      <view class="btn active-btn" @click="goon">同意并继续</view>
      <view class="t-center  c-60" @click="quite">取消</view>
    </view>
  </u-popup>
  <Protocol :show="showModal" :type="type" @close="showModal = false" @confirm="showModal = false" />
</view>
</template>
<script>
import Protocol from "../../../compennts/agreement/modal.vue";
export default {
    components:{
        Protocol
    },
  props: {
    show: Boolean,
  },
  data() {
    return {
        showModal:false,
        type:1
    };
  },
  watch: {
    show: {
      handler(val) {
        if (val) {
          uni.setTabBarStyle({
            color: "#918f8f",
            backgroundColor: "#7f7f7f",
          });
          uni.setTabBarItem({
            index: 1,
            pagePath: "/pages/index/index",
          });
          uni.setTabBarItem({
            index: 2,
            pagePath: "/pages/index/index",
          });
          uni.setTabBarItem({
            index: 3,
            pagePath: "/pages/index/index",
          });
        } else {
          uni.setTabBarStyle({
            color: "#7A7E83",
            backgroundColor: "#ffffff",
          });
          uni.setTabBarItem({
            index: 1,
            pagePath: "/pages/extend/index",
          });
          uni.setTabBarItem({
            index: 2,
            pagePath: "/pages/data/index",
          });
          uni.setTabBarItem({
            index: 3,
            pagePath: "/pages/mine/index",
          });
        }
      },
      deep: true,
      immediate: true,
    },
  },
  methods: {
    goon(){
        // 本地记录
        uni.setStorageSync('hasProtocalShow', 1)
        this.$emit('hide')
    },
    quite() {
      if (uni.getSystemInfoSync().platform === "ios") {
        plus.runtime.launchApplication({ action: "QUIT" });
      } else {
        plus.runtime.quit();
      }
    },
  },
};
</script>
<style lang="less" scoped>
@import url("../../../assets/styles/common");
.box {
  background-color: #fff;
  width: 542rpx;
  border-radius: 32rpx;
  padding: 32rpx;
  box-sizing: border-box;
  .title {
    font-family: PingFang SC, PingFang SC;
    font-weight: bold;
    font-size: 36rpx;
    color: #070b1c;
    text-align: center;
    margin-bottom: 16rpx;
  }
  .tip {
    font-weight: 400;
    font-size: 14px;
    color: rgba(7, 11, 28, 0.8);
    line-height: 40rpx;
    .pro{
        color:rgba(67, 106, 243, 1);
    }
  }
  .active-btn{
    height: 80rpx;
    margin-top: 32rpx;
    margin-bottom: 24rpx;
  }
  .cancel-btn{
    // color:
  }
}
/deep/ .u-popup__content {
  border-radius: 32rpx;
  overflow: hidden;
}
</style>
